#include <QtGui/QApplication>
#include "mtwidget.h"
#include "mtgv.h"
#include "qtuiolistener.h";
#include "TUIO/TuioClient.h"

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);


    QGraphicsScene* scene = new QGraphicsScene();
    MTWidget* p = new MTWidget(QPixmap(QPixmap(QString("borboleta2.jpg"))));
    scene->addItem(p);
    p->scale(0.6,0.6);
    p->setPos(300,200);

    /*MTWidget* p2 = new MTWidget(QPixmap(QPixmap(QString("borboleta.jpg"))));
    p2->scale(0.2,0.2);
    scene->addItem(p2);
    */
    scene->setSceneRect(0,0,800,600);
    MTGV* view = new MTGV(scene);

    QTuioListener *myListener = new QTuioListener();
    TuioClient *tuioClient = new TuioClient();
    tuioClient->addQTuioListener(myListener);
    tuioClient->connect();


    QObject::connect(myListener, SIGNAL(touch(int, double,double, int)),
                     dynamic_cast<MTGV*>(view), SLOT(onTouch(int, double,double, int)));

    view->setFixedSize(QSize(800,600));
    view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    view->setBackgroundBrush(QBrush("black"));
    view->showMaximized();


    return app.exec();
}
